{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python's `random` Library [demonstration]\n",
    "The code below demonstrates how a library (like `random`) can be **imported** and then used.\n",
    "\n",
    "Run the cells below in order."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# `random` is a Python \"module\". It provides functionality associated\n",
    "# with randomness / probability. For now you don't need to know exactly\n",
    "# what is happening when we write `import random as rd`, instead focus \n",
    "# on how we USE this module.\n",
    "import random as rd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "a is 0.7824560155389038\n",
      "b is 0.5530285424226059\n",
      "c is 0.752326147980375\n",
      "Now keep pressing Ctrl+Enter to run this cell many times!\n",
      "Notice how the values of a,b, and c keep changing!\n"
     ]
    }
   ],
   "source": [
    "# Call the FUNCTION named random 3 times and assign the result of each\n",
    "# call to a variable.\n",
    "a = rd.random()\n",
    "b = rd.random()\n",
    "c = rd.random()\n",
    "print(\"a is\", a)\n",
    "print(\"b is\", b)\n",
    "print(\"c is\", c)\n",
    "\n",
    "# random isn't the only function in the random module.\n",
    "# Do a google search for \"python random library\" or \n",
    "# go here: https://docs.python.org/3/library/random.html\n",
    "# to learn more.\n",
    "\n",
    "print(\"Now keep pressing Ctrl+Enter to run this cell many times!\")\n",
    "print(\"Notice how the values of a,b, and c keep changing!\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
